package com.example.blog.mapper;

import com.example.blog.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Question ArticleMapper
 * @Date 2023/1/6 10:17
 * @Solution
 */
@Mapper
public interface ArticleMapper {
    public List<ArticleInfo> getByUid(@Param("uid") int uid,@Param("state") int state);
    public ArticleInfo getById(@Param("id") int id);
    public int add(@Param("title") String title,@Param("content") String content,@Param("uid") int uid
            ,@Param("state") int state,@Param("createtime") String createtime,@Param("updatetime") String updatetime);
    public int del(@Param("id") int id);
    public void rcountAdd(@Param("id") int id);
    public void updateState(@Param("title") String title,@Param("content") String content,@Param("state") int state,
                            @Param("id") int id,@Param("oldState") int oldState);
    public List<ArticleInfo> getAll();
    public List<ArticleInfo> getList(@Param("uid") int uid,@Param("state") int state,@Param("psize") int psize
            ,@Param("offset") int offset);
    public List<ArticleInfo> getAllList(@Param("state") int state,@Param("psize") int psize
            ,@Param("offset") int offset);

}
